package gui.timecontrols;

import gui.TourneyManView;
import tournamentmanager.Preferences;

public class FixedTimeControl extends TimeControls {

    public FixedTimeControl(TourneyManView tourneyManView, Preferences model) {
        super(tourneyManView, model);
    }

    public void loadFromModel() {
        refresh();
        tourneyManView.spnTimeControl.setSelection(model.getCurrentTournament().getTimeControl());
    }

    public void loadFromView() {
        refresh();
        model.getCurrentTournament().setTimeIncrement(0);
    }

    void refresh() {
        tourneyManView.chcTimeControlType.select(1);
        tourneyManView.spnTimeIncrement.setEnabled(false);
        tourneyManView.spnMovesPerSession.setEnabled(false);
    }
}
